﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DBHelper;
using BusinessLayer.RegInfo.Entities;
using System.Data.SqlClient;
using System.Data;

namespace BusinessLayer.RegInfo
{    
    public class AccountTokenBL
    {
        private readonly DbHelper _db;

        public AccountTokenBL()
        {
            _db = new DbHelper(new DbConfig().DbRegInfoConnectionString);         
        }

        public void Insert(AccountToken accountToken)
        {
            var oCommand = new SqlCommand("sp_AccountToken_Insert") { CommandType = CommandType.StoredProcedure };
            oCommand.Parameters.Add(new SqlParameter("@AccountId", accountToken.AccountId));
            oCommand.Parameters.Add(new SqlParameter("@TokenKey", accountToken.TokenKey));
            _db.ExecuteNonQuery(oCommand);
        }
    }
}
